Unoffical empeg BBS

Quick Links: Empeg FAQ | RioCar.Org | Hijack | BigDisk Builder | jEmplode | emphatic
Repairs: Repairs

Topic Options
#319798 - 26/02/2009 12:20 "Repair" Debian installation
Roger
carpal tunnel

Registered: 18/01/2000
Posts: 5680
Loc: London, UK
If you've been following my other posts, you'll know that I hosed my VPS, and that the restore didn't go too well. What I'd like to do now is repair it.

By that I mean: is there a command-line that I can run that takes a look at the currently-installed packages and reapplies the binaries?

It's Debian 'etch', by the way.

I've got a recent, but suspect, local backup, and a less-recent, but less-supect, local backup so I'm not too bothered about my data.
_________________________
-- roger

Top
#319799 - 26/02/2009 12:38 Re: "Repair" Debian installation [Re: Roger]
peter
carpal tunnel

Registered: 13/07/2000
Posts: 4172
Loc: Cambridge, England
Code:
apt-get --reinstall install `dpkg-query -W -f '${Package}\n'`

..? Or perhaps this is the ideal time to upgrade to Lenny?

Peter

Top
#319800 - 26/02/2009 12:41 Re: "Repair" Debian installation [Re: peter]
peter
carpal tunnel

Registered: 13/07/2000
Posts: 4172
Loc: Cambridge, England
Oh, and I suppose "apt-get clean" first, if you also don't trust the contents of /var/cache/apt.

Peter

Top
#319801 - 26/02/2009 12:42 Re: "Repair" Debian installation [Re: peter]
Roger
carpal tunnel

Registered: 18/01/2000
Posts: 5680
Loc: London, UK
Originally Posted By: peter
Code:
apt-get --reinstall install `dpkg-query -W -f '${Package}\n'`

..? Or perhaps this is the ideal time to upgrade to Lenny?

Peter


It was upgrading to Lenny that broke it -- the VPS hypervisor barfed...

As an aside, I came up with the following:

Code:
dpkg --get-selections | grep \\binstall\\b | cut -f1 | xargs aptitude reinstall

_________________________
-- roger

Top
#319802 - 26/02/2009 12:54 Re: "Repair" Debian installation [Re: peter]
Roger
carpal tunnel

Registered: 18/01/2000
Posts: 5680
Loc: London, UK
Code:
aptitude reinstall -f `dpkg-query -W -f '${Package}\n'`
E: I wasn't able to locate a file for the <whatever> package. This might mean you need to manually fix this package.
 (due to missing arch)
<a few more of those>
E: Couldn't lock list directory..are you root?


Yes, I bloody well am. mad
_________________________
-- roger

Top
#319803 - 26/02/2009 12:56 Re: "Repair" Debian installation [Re: Roger]
Roger
carpal tunnel

Registered: 18/01/2000
Posts: 5680
Loc: London, UK
Bizarrely, using apt-get seems to be working. It even tells me that the missing files are missing from the FTP server. Which is useful to know.
_________________________
-- roger

Top
#319804 - 26/02/2009 13:59 Re: "Repair" Debian installation [Re: Roger]
wfaulk
carpal tunnel

Registered: 25/12/2000
Posts: 16706
Loc: Raleigh, NC US
Maybe aptitude has trouble with multiple package names on the command line?
_________________________
Bitt Faulk

Top
#319805 - 26/02/2009 14:10 Re: "Repair" Debian installation [Re: wfaulk]
Roger
carpal tunnel

Registered: 18/01/2000
Posts: 5680
Loc: London, UK
Originally Posted By: wfaulk
Maybe aptitude has trouble with multiple package names on the command line?


Not usually, no.
_________________________
-- roger

Top
#319806 - 26/02/2009 14:19 Re: "Repair" Debian installation [Re: Roger]
Roger
carpal tunnel

Registered: 18/01/2000
Posts: 5680
Loc: London, UK
Originally Posted By: Roger
Bizarrely, using apt-get seems to be working. It even tells me that the missing files are missing from the FTP server. Which is useful to know.


Ah. Spoke too soon -- apt-get can't reinstall more than one thing at a time -- it thinks there are dependency cycles.

Turning the output from the dpkg-get command into a shell script seems to be working.
_________________________
-- roger

Top
#319813 - 26/02/2009 17:15 Re: "Repair" Debian installation [Re: Roger]
Roger
carpal tunnel

Registered: 18/01/2000
Posts: 5680
Loc: London, UK
Originally Posted By: Roger
Turning the output from the dpkg-get command into a shell script seems to be working.


Seems to have worked. Everything is now (allegedly) reinstalled. I should therefore be able to trust my binaries.

I've restored the MySQL database for my CMS (drupal). I'll do the Gallery2 ones in a moment.

I'll verify my qmail (and other) installation by checking hashes against an older backup.

What's not good is that the following...

Code:
find . -type f -exec file {} \; | grep RFC\ 822


...is returning a list of files that shouldn't be emails, such as the avatars on my website.

What a mess. frown
_________________________
-- roger

Top